<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<jsp:useBean id="itemDate" class="java.util.Date" />
<jsp:setProperty name="itemDate" property="time" value="${xsdEntry.timeStamp}" />

<h1>${xsdEntry.fileName}</h1>

<span class="entry-version"><fmt:formatDate pattern="dd. MM. yyyy hh:mm:ss" value="${itemDate}" dateStyle="long" timeZone="GMT+2"/></span>
<span class="entry-remove"><a href="${pageContext.request.contextPath}/xsd/delete/${xsdEntry.fileName}/${xsdEntry.timeStamp}" onclick="return confirm('Do you really want to delete this version?')">Delete</a></span>
<span class="entry-download"><a href="${pageContext.request.contextPath}/xsd/download/${xsdEntry.fileName}/${xsdEntry.timeStamp}">Download .xsd</a></span>

<div>
    <div class="column">
        <ul class="list-group">
            <li class="list-group-item active">Elements and attributes<span class="badge">${f:length(xsdEntry.elements)}</span></li>
                <c:choose>
                    <c:when test="${f:length(xsdEntry.elements) gt 0}">
                        <c:forEach var="element" items="${xsdEntry.elements}">
                        <li class="list-group-item">
                            ${element.key}
                            <ul>
                                <c:forEach var="item" items="${element.value}" varStatus="loop">
                                    <li>
                                        ${item}
                                    </li>
                                </c:forEach>
                            </ul>
                        </li>
                    </c:forEach>
                </c:when>
                <c:otherwise>
                </c:otherwise>
            </c:choose>
        </ul>
    </div>

    <div class="column">
        <ul class="list-group">      
            <li class="list-group-item active">Simple types<span class="badge">${f:length(xsdEntry.simpleTypes)}</span></li>
                <c:choose>
                    <c:when test="${f:length(xsdEntry.simpleTypes) gt 0}">
                        <c:forEach var="item" items="${xsdEntry.simpleTypes}">
                        <li class="list-group-item">${item.name}</li>
                        </c:forEach>
                    </c:when>
                    <c:otherwise>
                </c:otherwise>
            </c:choose>
        </ul>
    </div>


    <div class="column">
        <ul class="list-group">  
            <li class="list-group-item active">Complex types<span class="badge">${f:length(xsdEntry.complexTypes)}</span></li>
                <c:choose>
                    <c:when test="${f:length(xsdEntry.complexTypes) gt 0}">
                        <c:forEach var="item" items="${xsdEntry.complexTypes}">
                        <li class="list-group-item">${item.name}</li>
                        </c:forEach>

                </c:when>
                <c:otherwise>
                </c:otherwise>
            </c:choose>
        </ul>
    </div>
</div>

<pre class="brush: xml">
    ${xsdEntry.XSDContent}
</pre>

